﻿using EntityFramework.Entity.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YouTravel.Framework.Enums;

namespace YouTravel.DomainModels
{
    /// <summary>
    /// 合同
    /// </summary>
    public class Contract : EntityBase
    {
        /// <summary>
        /// 机构Id
        /// </summary>
        public int? BranchId { get; set; }
        /// <summary>
        /// 机构
        /// </summary>
        public virtual Branch Branch { get; set; }
        /// <summary>
        /// 专线Id
        /// </summary>
        public int? SpecialId { get; set; }
        /// <summary>
        /// 专线
        /// </summary>
        public virtual Special Special { get; set; }
        /// <summary>
        /// 销售商/供应商信息
        /// </summary>
        public int? SellerSupplierId { get; set; }
        /// <summary>
        /// 销售商/供应商信息
        /// </summary>
        public virtual SellerSupplier SellerSupplier { get; set; }

        /// <summary>
        /// 合同名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 合同编号
        /// YTHT+当前日期+3位随机数
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 合同类型
        /// </summary>
        public ContractType Type { get; set; }
        /// <summary>
        /// 合同状态
        /// 1-正常 2-续约 3-关闭 4-废弃
        /// </summary>
        public ContractStatus Status { get; set; }
        /// <summary>
        /// 合同起始时间
        /// </summary>
        public DateTime? StartDate { get; set; }
        /// <summary>
        /// 合同到期时间
        /// </summary>
        public DateTime EndDate { get; set; }
        /// <summary>
        /// 附件集合
        /// </summary>
        public virtual ICollection<Attachment> Attachments { get; set; }
        /// <summary>
        /// 创建人Id
        /// </summary>
        public int CreaterId { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public virtual User Creater { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 更新人Id
        /// </summary>
        public int UpdaterId { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        public virtual User Updater { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
    }
}
